package com.dsp.util;

import java.net.URLEncoder;
import java.util.logging.Level;
import java.util.logging.Logger;

public class QueryData {
	private static final Logger log = Logger.getLogger(QueryData.class.toString());
	
	public static String encode (String value, String encoding){
		try {
			return URLEncoder.encode(value, encoding).replace("+", "%20").replace("%2F", "/").replace("@", "%40");
		} catch (Exception ex) {
			log.log(Level.WARNING, "Encoding Failed", ex);
			return value;
		}
	}
}